# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=python-hacking
pkgver=6.0.0
_commit=3fde1e570a064ce38e7c512b16610ff4650426c3
pkgrel=1
arch=('any')
pkgdesc='OpenStack Hacking Guideline Enforcement'
url='https://docs.openstack.org/developer/hacking'
license=('Apache')
depends=('flake8')
makedepends=('git' 'python-pbr' 'python-setuptools')
checkdepends=('python-subunit' 'python-stestr' 'python-testscenarios' 'python-testtools'
              'python-ddt' 'python-eventlet')
source=("git+https://github.com/openstack/hacking.git#commit=$_commit")
sha512sums=('SKIP')

prepare() {
  cd hacking
  sed -i 's/~=/>=/' requirements.txt
}

build() {
  cd hacking
  python setup.py build
}

check() {
  cd hacking
  stestr run
}

package() {
  cd hacking
  python setup.py install --root "$pkgdir" --optimize=1
}
